import request from "@/utils/request";


export function getList(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/findPage",
		method: "get",
		params: data,
	});
}

//分页查询备课记录
export function findPageListBeiKeList(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/findPageListBeiKeList",
		method: "get",
		params: data,
	});
}

export function getListByBeiKe(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/findPageByBeiKe",
		method: "get",
		params: data,
	});
}

export function findPageAndLpcCourseRecord(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/findPageAndLpcCourseRecord",
		method: "get",
		params: data,
	});
}

export function getListByCustomerIdAndDate(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/getListByCustomerIdAndDate",
		method: "get",
		params: data,
	});
}

export function jiachubagnding(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/jiachubagnding",
		method: "get",
		params: data,
	});
}

export function 语音识别测试(data) {
	return request({
		url: "/Task/语音识别测试",
		method: "get",
		params: data,
	});
}

export function fromData2(data) {
	return request({
		url: "/appTeacher/index/updatefromData2",
		method: "post",
		data,
	});
}

export function getDataFormPc(data) {
	return request({
		url: "/appTeacher/index/getDataFormPc",
		method: "post",
		data,
	});
}

export function findPage2(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/findPage2",
		method: "get",
		params: data,
	});
}

//发布 通知家长 id
export function fabutongzhiById(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/fabutongzhiById?id=" + data,
		method: "get",
		task: true
	});
}

export function xiazaibeike(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/xiazaibeike",
		method: "get",
		params: data,
		task: true
	});
}

export function test(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/test",
		method: "get",
		params: data,
	});
}

export function doInsert(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/insert",
		method: "post",
		data,
		task: true
	});
}

export function doUpdate(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/update",
		method: "post",
		data,
		task: true
	});
}

export function doUpdateField(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/doUpdateField",
		method: "get",
		params: data,
		task: true
	});
}

export function doDelete(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/del",
		method: "get",
		params: data,
		task: true
	});
}

export function truancy(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/truancy",
		method: "post",
		params: data,
		task: true
	});
}

export function cancelsSign(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/cancelsSign",
		method: "post",
		params: data,
		task: true
	});
}

export function cancelTruancy(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/cancelTruancy",
		method: "post",
		params: data,
		task: true
	});
}

export function signOk(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/signOk",
		method: "post",
		params: data,
		task: true
	});
}

export function revertCancels(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/revertCancels",
		method: "post",
		params: data,
		task: true
	});
}

export function doDeleteAll(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/delAll",
		method: "post",
		params: data,
		task: true
	});
}

/**
 * 导出Excel 目前只支持一层参数传递
 * @param data
 * @returns file
 */
export function doExportExcel(data) {
	let requestURL = "/api/v1/system/scheduleTimetable/exportExcel";
	// 下载文件
	downloadFileByData(requestURL, data);
}

/**
 * 下载模版
 * @returns file
 */
export function doDownloadTemplate() {
	let data = {};
	let requestURL = "/api/v1/system/scheduleTimetable/importExcel/template";
	// 下载文件
	downloadFileByData(requestURL, data);
}

/**
 * 导入Excel
 * @returns file
 */
export function doImportExcel(data) {
	return request({
		url: "/api/v1/system/scheduleTimetable/importExcel",
		method: "post",
		// 最长超时时间 3 分钟
		timeout: 180000,
		headers: {
			"Content-Type": "multipart/form-data",
		},
		data,
	});
}